import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
	redirect:"/login"
  },	
  {
    path: '/login',
  	component:() => import('../views/Login.vue'),
  },	
  {
    path: '/home',
    name: 'Home',
    component:() => import('../views/Home.vue'),
	children:[
		{
		  path: '/playinformation',
		  name: 'playinformation',
		  component:() => import('../views/home/PlayerInformation.vue'),
		  meta:{comp:"/playinformation",pathname:"玩家管理",name:"玩家信息"}
		},
		{
		  path: '/newguide',
		  name: 'newguide',
		  component:() => import('../views/home/NewGuide.vue'),
		  meta:{comp:"/newguide",pathname:"玩家管理",name:"新手引导"}
		},
		{
		  path: '/rolezr',
		  name: 'rolezr',
		  component:() => import('../views/home/RoleZR.vue'),
		  meta:{comp:"/rolezr",pathname:"角色管理",name:"角色整容"}
		},
		{
		  path: '/recharge',
		  name: 'recharge',
		  component:() => import('../views/home/Recharge.vue'),
		  meta:{comp:"/recharge",pathname:"角色管理",name:"充值玩家"}
		},
		{
		  path: '/hangup',
		  name: 'hangup',
		  component:() => import('../views/home/HangUP.vue'),
		  meta:{comp:"/hangup",pathname:"角色管理",name:"挂机关卡"}
		},
		{
		  path: '/dwrecharge',
		  name: 'dwrecharge',
		  component:() => import('../views/home/dwRecharge.vue'),
		  meta:{comp:"/dwrecharge",pathname:"付费与货币",name:"档位充值"}
		},
		{
		  path: '/racedrawtimes',
		  name: 'racedrawtimes',
		  component:() => import('../views/home/Racedrawtimes.vue'),
		  meta:{comp:"/racedrawtimes",pathname:"付费与货币",name:"种族抽"}
		},
		{
		  path: '/retention',
		  name: 'retention',
		  component:() => import('../views/home/Retention.vue'),
		  meta:{comp:"/retention",pathname:"留存率",name:"留存率查询"}
		},
		{
		  path: '/activationcode',
		  name: 'activationcode',
		  component:() => import('../views/home/Activationcode.vue'),
		  meta:{comp:"/activationcode",pathname:"激活码",name:"激活码查询"}
		},
		{
		  path: '/rolegift',
		  name: 'rolegift',
		  component:() => import('../views/home/Rolegift.vue'),
		  meta:{comp:"/rolegift",pathname:"物品流水",name:"角色物品流水"}
		},
		{
		  path: '/notice',
		  name: 'notice',
		  component:() => import('../views/home/Notice.vue'),
		  meta:{comp:"/notice",pathname:"公告/跑马灯",name:"公告"}
		},
		{
		  path: '/pmd',
		  name: 'pmd',
		  component:() => import('../views/home/Pmd.vue'),
		  meta:{comp:"/pmd",pathname:"公告/跑马灯",name:"跑马灯"}
		},
		{
		  path: '/mail',
		  name: 'mail',
		  component:() => import('../views/home/Mail.vue'),
		  meta:{comp:"/mail",pathname:"邮件管理",name:"邮件查询"}
		},
		{
		  path: '/ban',
		  name: 'ban',
		  component:() => import('../views/home/Ban.vue'),
		  meta:{comp:"/ban",pathname:"封禁",name:"封禁查询"}
		},
	]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
export default router
